<?php
//获取根目录$path
require_once '../common/RootPath.php';
RootPath::importPath("common/RequestHandler.php");


abstract class BaseAction extends RequestHandler
{
    public function GetMapping($args)
    {
        if (parent::isEmptyArgs($args)) {
            $pages = array(
                "page" => 1,
                "pagesize" => 10
            );
            $this->select($pages);

        } else {
            $this->select($args);
        }
    }

    public function PostMapping($args)
    {
        $this->save($args);
    }

    public function PutMapping($args)
    {
        $this->update($args);
    }

    public function DeleteMapping($args)
    {
        $this->delete($args);
    }

    //查询全部带分页
   public abstract function select($args);

    public abstract function save($args);

    public abstract function update($args);

    public abstract function delete($args);

}

